package com.dyh.service.serviceImpl;

import com.dyh.dao.familyDao;
import com.dyh.po.family;
import com.dyh.po.familyMain;
import com.dyh.service.familyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("familyService")
@Transactional
public class familyServiceImpl implements familyService {
    @Autowired
    private familyDao familydao;

    @Override
    public List<family> findAllFamily() {
        return familydao.findAllFamily();
    }

    @Override
    public family findFamilyById(String familyid) {
        return familydao.findFamilyById(familyid);
    }

    @Override
    public int addFamily(String proId, String cityId, String villId, String groupId, String familyId, String familyName, String familyNum, String agrNum, String address, String createtime, String logName) {
        return familydao.addFamily(proId, cityId, villId, groupId, familyId, familyName, familyNum, agrNum, address, createtime, logName);
    }

    @Override
    public int addFamilyMain(String fullname, String idNo, String sex, String birthday, String national, String health, String culture, String resAttribute, String agrRes, String marry, String workAdd, String telephone) {
        return familydao.addFamilyMain(fullname, idNo, sex, birthday, national, health, culture, resAttribute, agrRes, marry, workAdd, telephone);
    }

    @Override
    public familyMain findFamilyInfByName(String fullname) {
        return familydao.findFamilyInfByName(fullname);
    }

    @Override
    public Boolean editFamily(String familyId, String familyNum, String agrNum, String address, String createTime, String logName) {
        return familydao.editFamily(familyId, familyNum, agrNum, address, createTime, logName);
    }

    @Override
    public Boolean editFamilyMain(String fullname, String idNo, String sex, String birthday, String national, String health, String culture, String resAttribute, String agrResidence, String marry, String workAdd, String telephone) {
        return familydao.editFamilyMain(fullname, idNo, sex, birthday, national, health, culture, resAttribute, agrResidence, marry, workAdd, telephone);
    }

    @Override
    public Boolean deleteFamily(String familyId) {
        return familydao.deleteFamily(familyId);
    }
}
